package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SuperCouponReceiveMapper;
import com.ruoyi.system.domain.SuperCouponReceive;
import com.ruoyi.system.service.ISuperCouponReceiveService;

/**
 * 用户优惠券记录:记录优惠券发放/领取记录 Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-13
 */
@Service
public class SuperCouponReceiveServiceImpl implements ISuperCouponReceiveService 
{
    @Autowired
    private SuperCouponReceiveMapper superCouponReceiveMapper;

    @Override
    public SuperCouponReceive selectSuperCouponReceiveById(Long id)
    {
        return superCouponReceiveMapper.selectSuperCouponReceiveById(id);
    }

    @Override
    public List<SuperCouponReceive> selectSuperCouponReceiveList(SuperCouponReceive superCouponReceive)
    {
        return superCouponReceiveMapper.selectSuperCouponReceiveList(superCouponReceive);
    }

    /**
     * 统计用户可用优惠券数量（未使用、未删除、优惠券未删除）
     */
    @Override
    public int countUserAvailableCoupons(Long userId)
    {
        return superCouponReceiveMapper.countUserAvailableCoupons(userId);
    }

    @Override
    public int insertSuperCouponReceive(SuperCouponReceive superCouponReceive)
    {
        return superCouponReceiveMapper.insertSuperCouponReceive(superCouponReceive);
    }

    @Override
    public int updateSuperCouponReceive(SuperCouponReceive superCouponReceive)
    {
        return superCouponReceiveMapper.updateSuperCouponReceive(superCouponReceive);
    }

    @Override
    public int deleteSuperCouponReceiveByIds(Long[] ids)
    {
        return superCouponReceiveMapper.deleteSuperCouponReceiveByIds(ids);
    }

    @Override
    public int deleteSuperCouponReceiveById(Long id)
    {
        return superCouponReceiveMapper.deleteSuperCouponReceiveById(id);
    }
}
